package Utils;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.ScalarHandler;

import java.sql.SQLException;

public class MysqlTool {
    public static void main(String[] args) {
        System.out.println(getMD5passWord("qwe123"));
    }
    public static String getMD5passWord(String passWord){
        String sql = "select MD5(?);";
        QueryRunner queryRunner = new QueryRunner();
        String Word = " ";
        try {
            Word = (String)queryRunner.query(DBHelp.getConnection(), sql, new ScalarHandler(), passWord);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        } finally {
        }
        return Word;
    }
}
